<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="static/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
	$(function(){
		$("#dj4").click(function(){
			$.post("demo4",{"id":1,"uname":"aaaa"},function(r){
				alert(r);
			});
		});
		$("#dj5").click(function(){
			$.ajax({
				type: "POST",
				url: "demo5",
				contentType: "application/json",  //说明data必须是json字符串
				data: '[{"id":1,"username":"aaaa"},{"id":2,"username":"bbbb"}]',
				success: function(r){
				   alert( r );
				   $.each(r,function(i,o){
						alert(o.id+':'+o.username);
					});
			    }
			});	
		});
	});

</script>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<p>---UserVo---</p>
	<form action="demo" method="post">
		<p>id:<input type="text" name="id"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p><input type="submit" value="点击"/></p>
	</form>
	<p>---String[]---</p>
	<form action="demo3" method="post">
		<p>id:<input type="text" name="uname"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p><input type="submit" value="点击"/></p>
	</form>
	<p>---List&lt;String&gt;---</p>
	<form action="demo1" method="post">
		<p>id:<input type="text" name="uname"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p><input type="submit" value="点击"/></p>
	</form>
	<p>---map&lt;String,String&gt;---</p>
	<form action="demo2" method="post">
		<p>id:<input type="text" name="id"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p><input type="submit" value="点击"/></p>
	</form>
	------------------------------------------
	<p>---List&lt;UserVo&gt;---</p>
	<form action="demo4" method="post">
		<p>id:<input type="text" name="id"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p>id:<input type="text" name="id"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p><input type="button" id="dj4" value="点击"/></p>
	</form>
	<form action="demo4" method="post">
		<p>id:<input type="text" name="id"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p>id:<input type="text" name="id"/></p>
		<p>name:<input type="text" name="uname"/></p>
		<p><input type="button" id="dj5" value="点击"/></p>
	</form>
</body>
</html>